package com.snailhd.common.db.resultparsehander;

import com.snailhd.common.db.AbstractDBResultParseHandler;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @author hd
 * @description
 * @date 2019-08-18 09:42
 */
public class IntegerForDBResultParseHandler extends AbstractDBResultParseHandler {
    @Override
    public boolean supportsResult(Class clazz) {
        return Integer.class == clazz;
    }

    @Override
    public  Integer handle(ResultSet rs, Class clazz, String field) throws SQLException {
       Integer handleResult = rs.getInt(field);
       return handleResult;
    }
}
